package cn.v2tila.rsosa.student.service.serviceImpl;

import cn.v2tila.rsosa.student.entity.StudentEntity;
import cn.v2tila.rsosa.student.jpa.StudentJPA;
import cn.v2tila.rsosa.student.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author v2tila on 23:02 2019/2/24
 */
@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentJPA studentJPA;

    public boolean existsBySchoolNoAndNameAndNoAndPassword(
            String schoolNo, String name, String no, String password) {

        return studentJPA.existsBySchoolNoAndNameAndNoAndPassword(
                schoolNo, name, no, password);
    }

    @Override
    public StudentEntity findBySchoolNoAndNo(String schoolNo, String no) {
        return studentJPA.findBySchoolNoAndNo(schoolNo, no);
    }

    public StudentEntity findByNo(String no) {

        return studentJPA.findByNo(no);
    }

    @Override
    public StudentEntity findByUniqueId(String uniqueId) {
        return studentJPA.findByUniqueId(uniqueId);
    }


}
